home *** CD-ROM | disk | FTP | other *** search
- $STRING 4
-
-
-
- $INCLUDE "GEMDOS.INC"
-
- olddir$=curdir$
- olddrive$=left$(curdir$,1)
-
-
- editor$="GSEDIT.EXE"
-
-
- dim Feld1$(15)
- dim Feld2$(26)
- dim dir.fname$(200)
- dim dir.ftype(200)
- dim dir.select(200) : rem ALTER WERT: 1000 !!!!!!!!!!!!!!!!!!
- dim dir.fcmd(200)
-
-
-
-
-
-
- if command$=GemDOS$ then
- call PrepareScreen(50,"PC-Dateimanager")
- else
- call InitScreen(50,"PC-Dateimanager")
- end if
-
- call BoolGadget(5,26,15,1,"Lschen",2000)
- call BoolGadget(24,26,15,1,"Umbenennen",2001)
- call BoolGadget(42,26,15,1,"Kopieren",2002)
- call BoolGadget(60,26,15,1,"Editieren",2003)
-
- call MenuGadget(6,"Datei",10000)
- call MenuGadget(15,"Laufwerk",10001)
- call MenuGadget(28,"Einstellungen",10002)
- call MenuGadget(45,"Markieren",10003)
-
- call DrawNBorder(5,8,63,17,"")
- call BoolGadget(70,8,5,1,chr$(30),100)
- call BoolGadget(70,24,5,1,chr$(31),101)
- call BoolGadget(70,10,5,1,chr$(17),102)
- call BoolGadget(70,22,5,1,chr$(16),103)
- call BoolGadget(70,15,5,1,chr$(9),104)
- call BoolGadget(70,17,5,1,"\",105)
- for i=0 to 16
- call MinGadget(13,8+i,54,1,i)
- call MinGadget(6,8+i,6,1,500+i)
- next
-
- Feld1$(0)="Datei(en) lschen"
- Feld1$(1)="Datei(en) umbenennen"
- Feld1$(2)="Datei(en) kopieren"
- Feld1$(3)="Datei(en) editieren"
- Feld1$(4)="-"
- Feld1$(5)="Verzeichnis erstellen"
- Feld1$(6)="Verzeichnis lschen"
- Feld1$(7)="Verzeichnis wechseln"
- Feld1$(8)="-"
- Feld1$(9)="Information"
- Feld1$(10)="-"
- Feld1$(11)="DOS-Kommandointerpreter"
- Feld1$(12)="-"
- Feld1$(13)="Zurck zu AControl"
-
- Feld3$(0)=" Systemdateien anzeigen"
- Feld3$(1)=" Versteckte Dateien anzeigen"
- Feld3$(2)="-"
- Feld3$(3)=" Abfrage beim Lschen"
- Feld3$(4)=" Abfrage beim Kopieren"
- Feld3$(5)="-"
- Feld3$(6)="Voreinstellungen sichern"
-
- Feld4$(0)="Alle Dateien markieren"
- Feld4$(1)="Alle Dateien demarkieren"
-
- call NewWindow(10,12,60,3,0)
- color 15
- locate 14,12
- print "Angeschlossene Laufwerke werden getestet... Bitte warten!"
-
- call SetDrive(olddrive$)
- volumes=drives
- x=0
- z$=""
- for i=asc("A") to volumes+asc("A")
- if i>asc("B") then
- reg %ax,&H36*256
- reg %dx,i-asc("A")+1
- call interrupt &H21
-
- ax&=0
- def seg = varseg(ax&)
- pokei varptr(ax&),reg(%ax)
- if ax&=65535 then
- Feld2$(x)=chr$(i)+": 0 KB"+chr$(0)
- else
- x&=reg(%ax)*reg(%cx)*reg(%dx)
- x&=x&/1024
- x$=str$(x&) : e$="KB"
- if len(x$)>4 then
- x&=x&/1024
- x$=str$(x&)
- e$="MB"
- end if
- x$=string$(4-len(x$)," ")+x$+" "+e$
- Feld2$(x)=chr$(i)+":"+x$
- end if
- else
- reg %ax,&H08*256
- reg %dx,i-asc("A")
- call interrupt &H13
- select case int(reg(%bx) mod 256)
- case 1
- z$=" 320 KB"
- case 2
- z$=" 1.2 MB"
- case 3
- z$=" 720 KB"
- end select
- Feld2$(x)=chr$(i)+":"+z$
- end if
- x=x+1
- next
-
- call CloseWindow
-
- call CD(curdir$)
- call MouseOn
-
- ende=0
- while ende=0
- call MouseDown
- if mouse.button<>0 then call MouseHandler
-
- select case gad.num
- case 33333
- ende=1
- case 2000
- call DelFiles
- case 2001
- call RenFiles
- case 2002
- call CopyFiles
- case 2003
- call ViewFiles
- case 100
- if dir.pos>0 then
- dir.pos=dir.pos-1
- call ShowFiles
- else
- call Audio(1000,2)
- end if
- case 101
- if dir.pos<(dir.files)-17 then
- dir.pos=dir.pos+1
- call ShowFiles
- else
- call Audio(1000,2)
- end if
- case 102
- if dir.pos>17 then
- dir.pos=dir.pos-17
- call ShowFiles
- else
- dir.pos=0
- call ShowFiles
- end if
- case 103
- if dir.files>16 then
- if dir.pos<(dir.files-34) then
- dir.pos=dir.pos+17
- call ShowFiles
- else
- dir.pos=dir.files-17
- call ShowFiles
- end if
- end if
- case 104
- if len(dir.current$)>3 then
- call CD(dir.current$+"..")
- end if
- case 105
- call CD(left$(dir.current$,1)+":\")
- case 10000
- call MenuHandler(6,220,Feld1$(),14)
- select case menu.num
- case 13
- ende=1
- case 11
- call LoadNonApp("command",0)
- call DrawNBorder(5,8,63,17,"")
- call CD(left$(dir.current$,len(dir.current$)-1))
- case 0
- call DelFiles
- case 1
- call RenFiles
- case 2
- call CopyFiles
- case 3
- call ViewFiles
- case 9
- call InformationBox("PC-Filemanager - Version 1.0","Copyright (C) 1994 by","Thomas Dreibholz","All rights reserved.")
- end select
- case 10001
- call MenuHandler(15,100,Feld2$(),volumes)
- if menu.num<>-1 then
- call CD(chr$(asc("A")+menu.num)+":\")
- end if
- case 10002
- call MenuHandler(28,270,Feld3$(),7)
- select case menu.num
- case 0
- call CD(dir.current$)
- case 1
- call CD(dir.current$)
- end select
- case 10003
- call MenuHandler(45,220,Feld4$(),2)
- select case menu.num
- case 1
- for i=0 to dir.files-1
- dir.select(i)=0
- next
- call MouseOff
- for i=0 to 16
- typ=dir.ftype(i+dir.pos)
- if typ<>16 and typ<>64 and typ<>128 then
- locate i+9,14
- print " ";
- end if
- next
- call MouseOn
- case 0
- for i=0 to dir.files-1
- typ=dir.ftype(i)
- if typ<>16 and typ<>64 and typ<>128 then
- dir.select(i)=1
- end if
- next
- call MouseOff
- for i=0 to 16
- typ=dir.ftype(i+dir.pos)
- if typ<>16 and typ<>64 and typ<>128 then
- locate i+9,14
- call AsciiPrint(14,chr$(5))
- end if
- next
- call MouseOn
- end select
- case else
- if gad.num>=500 and gad.num<517 then
- if dir.fcmd(dir.pos+gad.num-500)=1 then
- call RunProg(dir.fname$(dir.pos+gad.num-500))
- end if
- elseif gad.num>=0 and gad.num<17 then
- if dir.ftype(dir.pos+gad.num)=16 then
- call CD(dir.current$+dir.fname$(dir.pos+gad.num))
- elseif dir.ftype(dir.pos+gad.num)=64 then
- elseif dir.ftype(dir.pos+gad.num)=128 then
- call CD(dir.current$+"..")
- else
- if dir.select(dir.pos+gad.num)=0 then
- dir.select(dir.pos+gad.num)=1
- z$=chr$(5)
- else
- dir.select(dir.pos+gad.num)=0
- z$=" "
- end if
- locate gad.num+9,14
- call MouseOff
- call AsciiPrint(14,z$)
- call MouseOn
- end if
- end if
- end select
-
- gad.num=-1
- wend
-
- call MouseOff
- call SetDrive(olddrive$)
- chdir olddir$
- end
-
- sub CD(x$) shared
- call NewWindow(20,12,40,5,0)
- call MouseOff
- color 15
- locate 14,22
- print "Neues Verzeichnis wird eingelesen:"
- locate 15,22
- print x$
- locate 16,22
- print "Bitte warten!"
- lw$=left$(x$,1)
- call SetDrive(lw$)
- dos.fehler=0
- 710 error 0
- 712 dummy$=curdir$
- 713 chdir x$
- 714 dummy$=dir$("*.*",8)
- if len(curdir$)>3 then dir.current$=curdir$+"\" else dir.current$=curdir$
- call DrawNBorder(5,6,70,1,dir.current$+string$(66-len(dir.current$)," "))
- call MouseOn
- if dos.fehler>0 and (dos.fzeile>=712 or dos.fzeile<=714) then
- dir.files=0
- dir.pos=0
- for i=0 to 36
- dir.fname$(i)=" "
- dir.ftype(i)=64
- dir.select(i)=0
- next
- call CloseWindow
- call ShowFiles
- exit sub
- end if
- call LoadDir
- end sub
-
- sub LoadDir shared
- x=16
- if ToggleMenuStatus(Feld3$(0))=1 then x=x+2
- if ToggleMenuStatus(Feld3$(1))=1 then x=x+4
- x$=dir$(dir.current$,x)
- if len(dir.current$)>3 then
- dir.files=1
- dir.ftype(0)=128
- else
- dir.files=0
- end if
- while x$<>""
- dir.fname$(dir.files)=x$
- dos.fehler=0
- dir.ftype(dir.files)=attrib(dir.current$+x$)
- tt$=right$(x$,4)
- if tt$=".EXE" or tt$=".COM" or tt$=".BAT" then
- dir.fcmd(dir.files)=1
- else
- dir.fcmd(dir.files)=0
- end if
- if dos.fehler<>0 then
- if dir.files<2 then
- dir.files=0
- dir.pos=0
- for i=0 to 36
- dir.fname$(i)=" "
- dir.ftype(i)=64
- dir.select(i)=0
- next
- call CloseWindow
- call ShowFiles
- exit sub
- end if
- end if
- dir.select(dir.files)=0
- error 0
- x$=dir$
- dir.files=dir.files+1
- wend
- for i=dir.files to dir.files+36
- dir.fname$(i)=" "
- dir.ftype(i)=64
- dir.select(i)=0
- next
- dir.pos=0
- call CloseWindow
- call ShowFiles
- end sub
-
- sub ShowFiles shared
- call MouseOff
- for i=dir.pos to dir.pos+16
- locate 9+i-dir.pos,8
- if dir.ftype(i)=16 then
- color 14
- print " <";dir.fname$(i);">";string$(14," ")
- elseif dir.ftype(i)=128 then
- color 2
- print " <..>"+string$(14," ")
- elseif dir.ftype(i)=64 then
- color 0
- print string$(24," ")
- else
- if dir.select(i)=1 then z$=chr$(5) else z$=" "
- if dir.fcmd(i)=1 then
- q$=chr$(9)+chr$(29)+chr$(9)+" "
- else
- q$=" "
- end if
- call AsciiPrint(10,q$)
- call AsciiPrint(14,z$)
- color 4
- print dir.fname$(i);string$(14," ")
- end if
- next
- call MouseOn
- end sub
-
- sub SetDrive(drv$) shared
- reg %ax,&H0D*256
- call interrupt &H21
- reg %ax,&H0E*256
- reg %dx,asc(drv$)-asc("A")
- call interrupt &H21
- drives=int(reg(%ax) mod 256)
- end sub
-
- function SFCount shared
- erg=0
- for i=0 to dir.files-1
- if dir.select(i)=1 then
- erg=erg+1
- end if
- next
- SFCount=erg
- end function
-
- sub DelFiles shared
- sf=SFCount
- if sf>0 then
- if ToggleMenuStatus(Feld3$(3))=1 then
- call NewWindow(15,12,50,7,1)
- call MouseOff
- call CenterInWindow(13,"Datei(en) lschen")
- locate 15,18
- print "Wollen Sie die Datei"
- locate 17,18
- print "wirklich lschen?"
- call BoolGadget(17,18,14,1,"Lschen",12000)
- call BoolGadget(49,18,14,1,"bergehen",12001)
- call BoolGadget(33,18,14,1,"Abbrechen",12002)
- call MouseOn
- dels=0
- for ii=0 to dir.files-1
- if dir.select(ii)=1 then
- locate 16,18
- f$=dir.current$+dir.fname$(ii)
- call MouseOff
- print f$;string$(48-len(f$)," ")
- call MouseOn
- ende1=0
- while ende1=0
- call MouseDown
- if mouse.button<>0 then
- call MouseHandler
- select case gad.num
- case 12000
- del=1
- ende1=1
- case 12001
- del=0
- ende1=1
- case 12002
- del=0
- ii=dir.files
- ende1=1
- end select
- end if
- wend
- if del=1 then
- dels=dels+1
- dos.fehler=0
- kill f$
- if dos.fehler<>0 then call Audio(2000,2)
- end if
- end if
- next
- call CloseWindow
- call CD(left$(dir.current$,len(dir.current$)-1))
- else
- call NewWindow(15,12,50,7,1)
- call MouseOff
- Call CenterInWindow(13,"Dateien lschen")
- locate 15,18
- print "Wollen Sie wirklich alle markierten Dateien"
- locate 16,18
- print "lschen?"
- call BoolGadget(17,17,14,1,"Lschen",12000)
- call BoolGadget(49,17,14,1,"Abbruch",12001)
- call MouseOn
- ende1=0
- while ende1=0
- call MouseDown
- if mouse.button<>0 then
- call MouseHandler
- select case gad.num
- case 12000
- del=1
- ende1=1
- case 12001
- del=0
- ende1=1
- end select
- end if
- wend
- call CloseWindow
- if del=1 then
- call NewWindow(15,12,50,2,0)
- locate 13,18
- call MouseOff
- print "Datei wird gelscht:"
- call MouseOn
- for ii=0 to dir.files-1
- if dir.select(ii)=1 then
- f$=dir.current$+dir.fname$(ii)
- locate 14,18
- call MouseOff
- print f$;string$(48-len(f$)," ")
- call MouseOn
- dos.fehler=0
- kill f$
- if dos.fehler<>0 then call Audio(2000,2)
- end if
- next
- call CloseWindow
- call CD(left$(dir.current$,len(dir.current$)-1))
- end if
- end if
- end if
- end sub
-
- sub CopyFiles shared
- sf=SFCount
- if sf>0 then
- call NewWindow(10,12,60,6,1)
- call CenterInWindow(13,"Datei(en) kopieren")
- call StrGadget(13,14,54,1,"D:\",51,10000)
- call BoolGadget(13,16,20,1,"Kopieren",12000)
- call BoolGadget(47,16,20,1,"Abbruch",12001)
- call MouseOn
- ende1=0
- while ende1=0
- call MouseDown
- if mouse.button<>0 then
- call MouseHandler
- select case gad.num
- case 12000
- s=1
- ende1=1
- case 12001
- s=0
- ende1=1
- end select
- end if
- wend
- nn$=GetGadgetText$(10000)
- call CloseWindow
- if s=1 then
- if nn$<>dir.current$ then
- if ToggleMenuStatus(Feld3$(4))=1 then
- call NewWindow(15,12,50,7,1)
- call MouseOff
- call CenterInWindow(13,"Datei(en) kopieren")
- locate 15,18
- print "Wollen Sie die Datei"
- locate 17,18
- print "wirklich kopieren?"
- call BoolGadget(17,18,14,1,"Kopieren",12000)
- call BoolGadget(49,18,14,1,"bergehen",12001)
- call BoolGadget(33,18,14,1,"Abbrechen",12002)
- call MouseOn
- for ii=0 to dir.files-1
- if dir.select(ii)=1 then
- locate 16,18
- f$=dir.current$+dir.fname$(ii)
- call MouseOff
- print f$;string$(48-len(f$)," ")
- call MouseOn
- ende1=0
- while ende1=0
- call MouseDown
- if mouse.button<>0 then
- call MouseHandler
- select case gad.num
- case 12000
- cpy=1
- ende1=1
- case 12001
- cpy=0
- ende1=1
- case 12002
- cpy=0
- ii=dir.files
- ende1=1
- end select
- end if
- wend
- if cpy=1 then
- call Kopiere
- end if
- end if
- next
- call CloseWindow
- else
- call NewWindow(15,12,50,2,0)
- locate 13,18
- call MouseOff
- print "Datei wird kopiert:"
- call MouseOn
- for ii=0 to dir.files-1
- if dir.select(ii)=1 then
- f$=dir.current$+dir.fname$(ii)
- locate 14,18
- call MouseOff
- print f$;string$(48-len(f$)," ")
- call MouseOn
- call Kopiere
- end if
- next
- call CloseWindow
- end if
- else
- call NewWindow(20,12,40,4,0)
- call CenterInWindow(13,"Datei(en) kopieren")
- locate 15,23 : print "Das Quellverzeichnis kann nicht"
- locate 16,23 : print "das Zielverzeichnis sein!"
- call MouseOn
- call WaitForClick
- call CloseWindow
- end if
- end if
- end if
- end sub
-
- sub Kopiere shared
- if right$(nn$,1)<>"\" then nn$=nn$+"\"
- dos.fehler=0
- open dir.fname$(ii) for binary access read as #1
- if dos.fehler=0 then
- open nn$+dir.fname$(ii) for binary access write as #2
- ok=0
- if dos.fehler=0 then
- while not eof(1)
- get$ #1,2048,dd$
- if dos.fehler=0 then
- put$ #2,dd$
- if dos.fehler<>0 then
- goto cpy.okay
- end if
- else
- goto cpy.okay
- end if
- wend
- ok=1
- cpy.okay:
- erase dd$
- close #1,#2
- if ok=0 then
- call Audio(2000,2)
- kill nn$+dir.fname$(ii)
- end if
- else
- call Audio(2000,2)
- close #1
- end if
- else
- call Audio(2000,2)
- end if
- end sub
-
- sub RunProg(n$) shared
- call NewWindow(5,12,70,5,1)
- call MouseOff
- color 15
- call CenterInWindow(13,"Programm "+dir.current$+n$+" aufrufen")
- n$=n$+" "
- call StrGadget(8,14,64,1,n$,61,12002)
- call BoolGadget(8,16,18,1,"Aufrufen",12000)
- call BoolGadget(54,16,18,1,"Abbruch",12001)
- call MouseOn
- ende1=0
- while ende1=0
- call MouseDown
- if mouse.button<>0 then
- call MouseHandler
- select case gad.num
- case 12000
- s=1
- ende1=1
- case 12001
- s=0
- ende1=1
- end select
- end if
- wend
- nn$=GetGadgetText$(12002)
- call CloseWindow
- if s=1 then
- call LoadNonApp(nn$,1)
- call DrawNBorder(5,8,63,17,"")
- call CD(left$(dir.current$,len(dir.current$)-1))
- end if
- end sub
-
- sub RenFiles shared
- sf=SFCount
- if sf>0 then
- call NewWindow(15,12,50,6,1)
- call CenterInWindow(13,"Datei(en) umbenennen")
- call BoolGadget(17,16,14,1,"Umbenennen",12000)
- call BoolGadget(49,16,14,1,"bergehen",12001)
- call BoolGadget(33,16,14,1,"Abbrechen",12002)
- call MouseOn
- for ii=0 to dir.files-1
- if dir.select(ii)=1 then
- color 15
- locate 15,17
- call MouseOff
- print dir.fname$(ii);" umbenennen in";
- call StrGadget(48,14,15,1,dir.fname$(ii),12,10000)
- call MouseOn
- ende1=0
- while ende1=0
- call MouseDown
- if mouse.button<>0 then
- call MouseHandler
- select case gad.num
- case 12000
- s=1
- ende1=1
- case 12001
- s=0
- ende1=1
- case 12002
- goto ren.okay
- end select
- end if
- wend
- nn$=GetGadgetText$(10000)
- call RemoveGadget(10000)
- if s=1 and nn$<>dir.fname$(ii) then
- color 15
- locate 15,17
- call MouseOff
- color 15
- xx$="Datei wird in "+nn$+" umbenannt..."
- print xx$;string$(46-len(xx$)," ")
- call MouseOn
- dos.fehler=0
- name dir.fname$(ii) as nn$
- if dos.fehler=0 then
- dir.fname$(ii)=nn$
- else
- call Audio(2000,2)
- end if
- end if
- end if
- next
- ren.okay:
- call CloseWindow
- call ShowFiles
- end if
- end sub
-
- sub ViewFiles shared
- sf=SFCount
- if sf>0 then
- for ii=0 to dir.files-1
- if dir.select(ii)=1 then
- call NewWindow(15,12,50,6,1)
- call CenterInWindow(13,"Datei(en) editieren")
- call BoolGadget(17,16,14,1,"Editieren",12000)
- call BoolGadget(49,16,14,1,"bergehen",12001)
- call BoolGadget(33,16,14,1,"Abbrechen",12002)
- color 15
- locate 15,18
- print "Datei ";dir.fname$(ii);" mit ";editor$;" anzeigen?"
- call MouseOn
- ende1=0
- while ende1=0
- call MouseDown
- if mouse.button<>0 then
- call MouseHandler
- select case gad.num
- case 12000
- s=1
- ende1=1
- case 12001
- s=0
- ende1=1
- case 12002
- call CloseWindow
- goto view.okay
- end select
- end if
- wend
- nn$=GetGadgetText$(10000)
- call CloseWindow
- if s=1 then
- call LoadNonApp(editor$+" "+dir.fname$(ii),0)
- call DrawNBorder(5,8,63,17,"")
- call ShowFiles
- end if
- end if
- next
- view.okay:
- call ShowFiles
- end if
- end sub